package io.github.sruby.springboot.security.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
* @Description: security
* @author: sruby
* @Date: 2020-2-16 16:04
*/
@Data
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
public class SecurityDO {
    @NotNull(message = "id cant be null")
    private String id;
    @NotNull(message = "code cant be null")
    @Length(min = 1,max = 20)
    @Pattern(regexp = "0-9a-zA-Z+",message = "code form by number、letter")
//    @Pattern(regexp = "[0-9]{1,20}",message = "code length is 1-20,form by number")
    private String code;
    @NotNull(message = "name cant be null")
    private String name;
}
